package com.bsoft.controller.JSON;


import com.bsoft.Exception.CommonException;
import com.bsoft.service.FoodborneIllnessService;
import com.bsoft.service.InvoicingBoozService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**食源性报卡控制器:[玉溪市中医院,]*/
@Controller
@RequestMapping("FoodborneIllness")
public class FoodborneIllnessController {
    private static Logger logger = LoggerFactory.getLogger(FoodborneIllnessController.class);
    @Autowired
    private FoodborneIllnessService foodborneIllnessService;


    /**
     * 食源性接口
     */
    @RequestMapping(value = "queryEscalationStatusList", produces = "application/json;charset=utf-8", method = RequestMethod.POST)
    @ResponseBody
    public String queryEscalationStatusList(@RequestBody Map<String, Object> req) throws Exception {
        String res = foodborneIllnessService.queryEscalationStatusList(req);
        return res;
    }

    /**
     * 食源性报卡数据上传
     */
    @RequestMapping(value = "updateFoodborneIllness", produces = "application/json;charset=utf-8", method = RequestMethod.POST)
    @ResponseBody
    public String updateFoodborneIllness(@RequestBody Map<String, Object> req) throws Exception {
        logger.info("食源性报卡:数据上传:入参：" + req);
        String res = foodborneIllnessService.updateFoodborneIllness(req);
        logger.info("食源性报卡:数据上传:出参" + res);
        return res;
    }
    /**
     * 食源性报卡新建病历
     */
    @RequestMapping(value = "loadFoodborneIllness", produces = "application/json;charset=utf-8", method = RequestMethod.POST)
    @ResponseBody
    public String loadFoodborneIllness(@RequestBody Map<String, Object> req) throws Exception {
        logger.info("食源性报卡:新建病历:入参：" + req);
        String res = foodborneIllnessService.loadFoodborneIllness(req);
        logger.info("食源性报卡:新建病历:出参" + res);
        return res;
    }

    /**
     * 食源性报卡信息查询
     */
    @RequestMapping(value = "searchUrl", produces = "application/json;charset=utf-8", method = RequestMethod.POST)
    @ResponseBody
    public String searchUrl(@RequestBody Map<String, Object> req) throws Exception {
        logger.info("食源性报卡:食源性报卡信息查询:入参：" + req);
        String res = foodborneIllnessService.searchUrl(req);
        logger.info("食源性报卡:食源性报卡信息查询:出参" + res);
        return res;
    }

    /**
     * 食源性报卡删除病历
     */
    @RequestMapping(value = "deleteFoodborneIllness", produces = "application/json;charset=utf-8", method = RequestMethod.POST)
    @ResponseBody
    public String deleteFoodborneIllness(@RequestBody Map<String, Object> req) throws Exception {
        logger.info("食源性报卡:删除病历:入参：" + req);
        String res = foodborneIllnessService.deleteFoodborneIllness(req);
        logger.info("食源性报卡:删除病历:出参" + res);
        return res;
    }

    /**
     * 食源性报卡申请召回病例
     */
    @RequestMapping(value = "recallFoodborneIllness", produces = "application/json;charset=utf-8", method = RequestMethod.POST)
    @ResponseBody
    public String recallFoodborneIllness(@RequestBody Map<String, Object> req) throws Exception {
        logger.info("食源性报卡:申请召回病例 :入参：" + req);
        String res = foodborneIllnessService.recallFoodborneIllness(req);
        logger.info("食源性报卡:申请召回病例 :出参" + res);
        return res;
    }

    /**
     * 食源性报卡 撤回病例
     */
    @RequestMapping(value = "revokeFoodborneIllness", produces = "application/json;charset=utf-8", method = RequestMethod.POST)
    @ResponseBody
    public String revokeFoodborneIllness(@RequestBody Map<String, Object> req) throws Exception {
        logger.info("食源性报卡:撤回病例  :入参：" + req);
        String res = foodborneIllnessService.revokeFoodborneIllness(req);
        logger.info("食源性报卡:撤回病例  :出参" + res);
        return res;
    }

}
